import { defineEventHandler, readBody } from 'h3';

export default defineEventHandler(async (event) => {
  const body = await readBody(event);
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  const { input, context: _context } = body;

  // 模拟退房行为执行
  const result = {
    status: 'completed' as const,
    output: {
      checkoutId: `checkout_${Date.now()}`,
      totalAmount: 299.99,
      status: 'completed',
      checkOutTime: new Date().toISOString(),
    },
    eventIds: [`evt_${Date.now()}`],
    state: 'cleaning',
  };

  return {
    code: 0,
    data: result,
    message: '退房行为执行成功',
  };
});
